// 联合类型

let types :number|string;
if(typeof types === 'number'){
    console.log(types.toFixed(2));
}



//never

function error(message:string):never{
    throw new Error(message);
}

function infiniteLoop():never{
    while(true){

    }
}
//字面量 类型

let num1:10;
// num1 =20;

//元祖类型（Tuple）

let tuple:[number,string];
tuple = [10,'hello'];

//枚举类型

enum Color{
  
    Red,
    Green,
    Blue
}

let c:Color = Color.Green;

//void

function warnUser():void{
    console.log('this is a warning message');
}